<p class="Head1"><help:paragraphinfo state="U" number="1"/><help:key-word value="Switch; function" tag="kw66497_1"/><help:link Id="66497">Switch Function [Runtime]</help:link></p>
<p class="Paragraph"><help:paragraphinfo state="U" number="2"/>Evaluates a list of arguments, consisting of an expression followed by a value. The Switch function returns a value that is associated with the expression that is passed by this function.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="6" xmlns:help="http://openoffice.org/2000/help"/>The <span class="T1">Switch</span> function evaluates the expressions from left to right, and then returns the value that is assigned to the function expression. If expression and value are not given as a pair, a runtime error occurs.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="7" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">Expression:</span> The expression that you want to evaluate.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="8" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">Value:</span> The value that you want to return if the expression is True.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="9" xmlns:help="http://openoffice.org/2000/help"/>In the following example, the <span class="T1">Switch</span> function assigns the appropriate gender to the name that is passed to the function:</p>